package com.meituan.catering.management.order.biz.model.converter;

import com.meituan.catering.management.order.biz.model.CateringOrderItemAccessoryBO;
import com.meituan.catering.management.order.dao.model.CateringOrderItemAccessoryDO;

import java.util.LinkedList;
import java.util.List;

/**
 * @author Believe
 * Date 2022/5/28 14:19
 */
public class CateringOrderItemAccessoryBOConverter {
    public static List<CateringOrderItemAccessoryBO> toCateringOrderItemAccessoryBO(List<CateringOrderItemAccessoryDO> orderItemAccessoryDOList){
        if (orderItemAccessoryDOList.isEmpty()){
            return null;
        }
        List<CateringOrderItemAccessoryBO> orderItemAccessoryBOList = new LinkedList<>();
        for (CateringOrderItemAccessoryDO cateringOrderItemAccessoryDO : orderItemAccessoryDOList) {
            CateringOrderItemAccessoryBO cateringOrderItemAccessoryBO = new CateringOrderItemAccessoryBO();
            cateringOrderItemAccessoryBO.setId(cateringOrderItemAccessoryDO.getId());
            cateringOrderItemAccessoryBO.setTenantId(cateringOrderItemAccessoryDO.getTenantId());
            cateringOrderItemAccessoryBO.setVersion(cateringOrderItemAccessoryDO.getVersion());
            cateringOrderItemAccessoryBO.setOrderItemId(cateringOrderItemAccessoryDO.getOrderItemId());
            cateringOrderItemAccessoryBO.setSeqNo(cateringOrderItemAccessoryDO.getSeqNo());
            cateringOrderItemAccessoryBO.setStatus(cateringOrderItemAccessoryDO.getStatus());
            cateringOrderItemAccessoryBO.setPlaceQuantity(cateringOrderItemAccessoryDO.getPlaceQuantity());
            cateringOrderItemAccessoryBO.setProduceQuantity(cateringOrderItemAccessoryDO.getProduceQuantity());
            cateringOrderItemAccessoryBO.setLatestQuantity(cateringOrderItemAccessoryDO.getLatestQuantity());
            cateringOrderItemAccessoryBO.setProductAccessoryId(cateringOrderItemAccessoryDO.getProductAccessoryId());
            cateringOrderItemAccessoryBO.setProductAccessoryNameOnPlace(cateringOrderItemAccessoryDO.getProductAccessoryNameOnPlace());
            cateringOrderItemAccessoryBO.setProductAccessoryGroupNameOnPlace(cateringOrderItemAccessoryDO.getProductAccessoryGroupNameOnPlace());
            cateringOrderItemAccessoryBO.setProductAccessoryUnitPriceOnPlace(cateringOrderItemAccessoryDO.getProductAccessoryUnitPriceOnPlace());
            cateringOrderItemAccessoryBO.setProductAccessoryUnitOfMeasureOnPlace(cateringOrderItemAccessoryDO.getProductAccessoryUnitOfMeasureOnPlace());
            orderItemAccessoryBOList.add(cateringOrderItemAccessoryBO);
        }
        return orderItemAccessoryBOList;
    }
}
